$filePath = $args[0];
$oldText = $args[1];
$newText = $args[2];

function ReplaceText($fileInfo)
{
    $old = $oldText;
    $new = $newText;

    (Get-Content $fileInfo.FullName) | % {$_ -replace $old, $new} | Set-Content -path $fileInfo.FullName
    "Processed: " + $fileInfo.FullName
}

if (test-path $filePath)
{ 
	$file = Get-Item $filePath;
	ReplaceText($file);
}
